package cn.dengta.webapp.user.entity;

import java.util.Date;

import cn.dengta.webapp.base.entity.TimeBasedEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import me.codeplayer.util.EasyDate;

/**
 * 万圣节活动完成/领取日志
 */
@Getter
@Setter
@TableName("act_halloween_log")
public class ActHalloweenLog extends TimeBasedEntity {

	/** 用户参与的万圣节活动标识 */
	private Long halloweenId;
	/** 类型：1=完成任务；2=领取任务; 3=兑换奖品 */
	private Integer type;
	/** 任务类型 */
	private String assocType;
	/** 任务id */
	private Long assocId;

	public static ActHalloweenLog of(Long halloweenId, Integer type) {
		ActHalloweenLog log = new ActHalloweenLog();
		log.setHalloweenId(halloweenId);
		log.setType(type);
		return log;
	}

	public static ActHalloweenLog of(Long halloweenId, Long taskId, String name, Integer type, Date date) {
		ActHalloweenLog actHalloweenLog = new ActHalloweenLog();
		actHalloweenLog.setHalloweenId(halloweenId);
		actHalloweenLog.setType(type);
		actHalloweenLog.setAssocType(name);
		actHalloweenLog.setAssocId(taskId);
		actHalloweenLog.initTime(date);
		return actHalloweenLog;
	}

}
